import pandas as pd
from textblob import TextBlob

def get_sentiment_score(text):
    blob = TextBlob(text)
    return blob.sentiment.polarity

if __name__ == '__main__':

    text_column = 'text'
    df = pd.read_excel('/Users/AyseEsra/Desktop/tweets - Refugees_English.xlsx')
    df['sentiment score'] = df[text_column].apply(get_sentiment_score)
    df.to_excel('sentiment_output.xlsx', index=False)


